<template>
	<view class="wrapper">
		<view class="img-wrap" v-if="imgList.length">
			<view class="img-item" v-for="(item, index) in imgList" :key="index">
				<u-image :radius="10" :showLoading="true" :src="item.url" width="150rpx" height="150rpx" :fade="true"
					duration="450" lazyLoad></u-image>
			</view>
		</view>
		<view class="empty-list" v-else>
			<u-empty mode="search">
			</u-empty>
		</view>
		<u-loading-page :loading="isloading" bg-color="rgba(0, 0, 0, .3)" loadingText=" "></u-loading-page>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList: [],
				isloading: false
			}
		},
		onLoad(options) {
			const {
				msg
			} = options
			this.isloading = true
			uni.request({
				url: 'https://api.52vmy.cn/api/wl/doutu',
				method: 'get',
				data: {
					msg
				},
				success: res => {
					this.isloading = false
					this.imgList = res.data.data || []
				},
				fail: err => {
					this.isloading = false
				}
			})
		},
		methods: {}
	}
</script>

<style scoped lang="scss">
	.img-wrap {
		width: 95%;
		margin: 0rpx auto 100rpx;
		display: flex;
		flex-wrap: wrap;

		.img-item {
			margin: 20rpx 1.1%;
			width: 20%;
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 10rpx;
			box-shadow: 0 0 5rpx #ccc;
			border-radius: 10rpx;
		}
	}

	.empty-lists {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 100vh;
	}
</style>